package com.ewancle.springhadoopjdbc.service;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;

public class TrinoService {
    // trino：https://trino.io/docs/current/client/jdbc.html
    // Impala 连接：https://blog.csdn.net/zyh19980605/article/details/123395569
    // Presto：https://blog.csdn.net/zhi_yin/article/details/129281256 和 https://www.shulanxt.com/datawarehouse/presto/prestojdbc
    // Iceberg ：https://iceberg.apache.org/docs/1.6.1/jdbc/#jdbc-catalog
    // Paimon：https://blog.csdn.net/xu470438000/article/details/134329889 和 https://zhuanlan.zhihu.com/p/14306209200
    public static void main(String[] args) {
        // properties
        String url = "jdbc:trino://example.net:8080/hive/sales";
        Properties properties = new Properties();
        properties.setProperty("user", "test");
        properties.setProperty("password", "secret");
        properties.setProperty("SSL", "true");
        try {
            Connection connection = DriverManager.getConnection(url, properties);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }

        // URL parameters
        /*String url = "jdbc:trino://example.net:8443/hive/sales?user=test&password=secret&SSL=true";
        Connection connection = DriverManager.getConnection(url);*/
    }
}
